<%@ Page language="c#" Codebehind="UserRolesEdit.aspx.cs" AutoEventWireup="True" Inherits="sow.EditUserRoles" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
	<HEAD>
		<title>EditPartner</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="C#" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
	</HEAD>
	<body>
		<h2 align="left"><FONT color="#0066ff">Users Table</FONT></h2>
		<form id="Form1" method="post" runat="server">
			<HR color="#006699" SIZE="10">
			&nbsp;
			<asp:datagrid id="DataGrid1" runat="server" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px"
				BackColor="White" CellPadding="3" PageSize="9" AllowSorting="True" AutoGenerateColumns="False"
				AllowPaging="True">
				<SelectedItemStyle Font-Bold="True" ForeColor="White" BackColor="#669999"></SelectedItemStyle>
				<ItemStyle ForeColor="#000066"></ItemStyle>
				<HeaderStyle Font-Bold="True" ForeColor="White" BackColor="#006699"></HeaderStyle>
				<FooterStyle ForeColor="#000066" BackColor="White"></FooterStyle>
				<Columns>
					<asp:ButtonColumn Text="Delete" ButtonType="PushButton" HeaderText="Delete" CommandName="Delete"></asp:ButtonColumn>
					<asp:EditCommandColumn ButtonType="PushButton" UpdateText="Update" HeaderText="Edit, Update, Cancel" CancelText="Cancel"
						EditText="Edit"></asp:EditCommandColumn>
					<asp:TemplateColumn SortExpression="UserID" HeaderText="UserID">
						<ItemTemplate>
							<asp:Label id="lblUserID" runat="server" Width="58px" Text='<%# DataBinder.Eval(Container, "DataItem.UserID") %>'>
							</asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox id="txtUserID" runat="server" Width="64px" Text='<%# DataBinder.Eval(Container, "DataItem.UserID") %>'>
							</asp:TextBox>
						</EditItemTemplate>
					</asp:TemplateColumn>
					<asp:TemplateColumn HeaderText="RoleID">
						<ItemTemplate>
							<asp:Label id=lblRoleID runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.RoleID") %>'>
							</asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:DropDownList id=drpRoleID runat="server" Width="68px" DataValueField="RoleID" DataTextField="RoleName" DataSource="<%# dsRole %>" SelectedIndex='<%# GetRoleIDIndex(DataBinder.Eval(Container.DataItem, "RoleID")) %>'>
							</asp:DropDownList>
						</EditItemTemplate>
					</asp:TemplateColumn>
					<asp:TemplateColumn SortExpression="Email" HeaderText="Email">
						<ItemTemplate>
							<asp:Label id=lblEmail runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Email") %>'>
							</asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox id=txtEmail runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Email") %>'>
							</asp:TextBox>
						</EditItemTemplate>
					</asp:TemplateColumn>
					<asp:TemplateColumn HeaderText="NickName">
						<ItemTemplate>
							<asp:Label id=lblNickName runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.NickName") %>'>
							</asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox id=txtNickName runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.NickName") %>'>
							</asp:TextBox>
						</EditItemTemplate>
					</asp:TemplateColumn>
					<asp:TemplateColumn HeaderText="Status">
						<ItemTemplate>
							<asp:Label id=lblStatus runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Status") %>'>
							</asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox id=txtStatus runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Status") %>'>
							</asp:TextBox>
						</EditItemTemplate>
					</asp:TemplateColumn>
					<asp:TemplateColumn HeaderText="Type">
						<ItemTemplate>
							<asp:Label id=lblType runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Type") %>'>
							</asp:Label>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox id=txtType runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Type") %>'>
							</asp:TextBox>
						</EditItemTemplate>
					</asp:TemplateColumn>
					<asp:TemplateColumn HeaderText="Description">
						<ItemTemplate>
							<asp:TextBox id=txtDesc runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Description") %>' ReadOnly="True" TextMode="MultiLine">
							</asp:TextBox>
						</ItemTemplate>
						<EditItemTemplate>
							<asp:TextBox id=txtDescription runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Description") %>' TextMode="MultiLine">
							</asp:TextBox>
						</EditItemTemplate>
					</asp:TemplateColumn>
				</Columns>
				<PagerStyle HorizontalAlign="Left" ForeColor="#000066" BackColor="White" Mode="NumericPages"></PagerStyle>
			</asp:datagrid>
			<P>
				<TABLE id="Table3" style="WIDTH: 100%; HEIGHT: 33px" cellSpacing="1" cellPadding="1" width="819"
					border="0">
					<TR>
						<TD bgColor="#99cccc">
							<P><FONT color="#ffffff">Role:
									<asp:dropdownlist id="lstRoleID" runat="server" Width="67px"></asp:dropdownlist>&nbsp;&nbsp; 
									Email:
									<asp:textbox id="txtEmail" runat="server" Width="170px"></asp:textbox>&nbsp;Password:
									<asp:textbox id="txtPassword" runat="server" Width="87px"></asp:textbox>&nbsp;NickName:
									<asp:textbox id="txtNickName" runat="server" Width="86px"></asp:textbox>&nbsp;</FONT></P>
							<P><FONT color="#ffffff">Status:
									<asp:dropdownlist id="lstStatus" runat="server" Width="67px"></asp:dropdownlist>&nbsp;</FONT><FONT color="#ffffff">Type:
									<asp:textbox id="txtType" runat="server" Width="37px"></asp:textbox>&nbsp;</FONT><FONT color="#ffffff">Description:
									<asp:textbox id="txtDesc" runat="server" Width="169px"></asp:textbox>&nbsp;CreatedBy:
									<asp:dropdownlist id="lstUser" runat="server" Width="76px"></asp:dropdownlist></FONT></P>
						</TD>
						<TD align="right" bgColor="#99cccc">
							<asp:button id="btnAdd" runat="server" Text="Add User" onclick="btnAdd_Click"></asp:button></TD>
					</TR>
				</TABLE>
			</P>
			<P><asp:label id="lblMessage" runat="server" Width="663px"></asp:label></P>
			<HR color="#006699" SIZE="10">
			<P>
			</P>
		</form>
	</body>
</HTML>
